<!--
 * @Description: 
 * @Author: william
 * @Date: 2025-09-23 16:19:34
 * @LastEditors: william
 * @LastEditTime: 2025-09-23 16:35:16
-->
<template>
  <CustomModal
    title="解绑炒菜机"
    v-model="visible"
    :showCancelButton="false"
    :confirmText="$t('system.unbind')"
    @confirm="modelConfirm"
  >
    <scroll-view class="scroll-content" scroll-y>
      <view class="nw-label">
        确认是否解绑该炒菜机SN：
        <view class="bold-text">【 {{ props.sn }} 】</view>
      </view>
    </scroll-view>
  </CustomModal>
</template>

<script setup>
defineOptions({
  name: 'UnBindStirFryDevice',
  inheritAttrs: false
})

const props = defineProps({
  sn: {
    type: String,
    default: ''
  }
})
const visible = defineModel({
  type: Boolean,
  default: false
})
const emit = defineEmits(['update'])
const { bindDeviceList } = storeToRefs(useDeviceStore())

const modelConfirm = _ => {
  bindDeviceList.value = bindDeviceList.value.filter(
    item => item.sn !== props.sn
  )
  visible.value = false
  emit('update')
}
</script>

<style lang="scss" scoped>
.nw-label {
  margin: 40rpx 0 20rpx;
  flex-direction: column;
  .bold-text {
    width: 100%;
    text-align: center;
    font-weight: 600;
  }
}
</style>
